#ifndef RBT_STREAM_INCLUDE
#define RBT_STREAM_INCLUDE
#include "../typedef.h"

RETURNCODE R_NOT_ENDOFSTREAM   =  207;

class Stream
{
public:
	enum SEEK_POSITION
	{
		BEGIN,
		END,
		CURRENT
	};

	virtual int32 CanRead()  = 0;
	virtual int32 CanWrite() = 0;
	virtual int32 CanSeek()  = 0;
	virtual int32 HaveEOS()  = 0;

	virtual int32 GetSize(     uint64& size     ) = 0;
	virtual int32 GetPosition( uint64& position ) = 0;
	virtual int32 Seek(        uint64  position , SEEK_POSITION flag = CURRENT ) = 0;

	virtual int32 Read(  byte* block , uint32 blockSize , uint32& fileRead ) = 0;
	virtual int32 Write( byte* block , uint32 blockSize , uint32& fileWrite ) = 0;

	virtual int32 Flush() = 0;

	virtual int32 EndOfStream() = 0;

	virtual int32 Close() = 0;
};

#endif